package com.gw.booking.dto;

import java.util.List;

public class PageDto<T> {
	private long total;
	private long size;	// 一页记录数
	private long page;	// 当前页
	private long totalPage;	// 总页数
	private List<T> items;
	
	public PageDto(long page, long size, long total, List<T> items) {
		this.total = total;
		this.page = page;
		this.size = size;
		this.totalPage = size == 0 ? 1 : new Double(Math.ceil(1.0 * total / size)).longValue();
		this.items = items;
	}
	
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public List<T> getItems() {
		return items;
	}
	public void setItems(List<T> items) {
		this.items = items;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public long getPage() {
		return page;
	}

	public void setPage(long page) {
		this.page = page;
	}

	public long getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}
}
